package com.novellotus.iov.carvice.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Rich on 2017/12/22.
 */

public class MainPagerAdapter extends FragmentPagerAdapter {

    List<Fragment> fragmentList;
    String[] tittles = {"首页", "工作", "消息", "我的"};

    public MainPagerAdapter(FragmentManager fragmentManager, List<Fragment> fragmentList) {
        super(fragmentManager);
        this.fragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tittles[position];
    }
}
